package org.loofer.uiframework.callback;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.View;

public interface IFragmentLifecycleCallback {

    public interface FragmentLifecycleCallbacks {
        void onFragmentAttached(Fragment fragment, Activity activity);

        void onFragmentCreated(Fragment fragment, Bundle bundle);

        void onFragmentDestroyed(Fragment fragment);

        void onFragmentDetached(Fragment fragment);

        void onFragmentPaused(Fragment fragment);

        void onFragmentResumed(Fragment fragment);

        void onFragmentSaveInstanceState(Fragment fragment, Bundle bundle);

        void onFragmentStarted(Fragment fragment);

        void onFragmentStopped(Fragment fragment);
    }

    public interface FragmentViewCallbacks {
        void onFragmentViewCreated(Fragment fragment, View view, Bundle bundle);
    }

    void registerFragmentLifecycleCallbacks(FragmentLifecycleCallbacks fragmentLifecycleCallbacks);

    void registerFragmentViewCallbacks(FragmentViewCallbacks fragmentViewCallbacks);

    void unregisterFragmentLifecycleCallbacks(FragmentLifecycleCallbacks fragmentLifecycleCallbacks);

    void unregisterFragmentViewCallbacks(FragmentViewCallbacks fragmentViewCallbacks);
}
